﻿using System;

using Game.Types;

namespace Game.Editor.Toolbox
{
    public class SelectedVehicleTypeEventArgs : EventArgs
    {
        public VehicleType VehicleType
        {
            get; set;
        }
    }
    
    public static class SelectedVehicleType
    {
        public static event EventHandler<SelectedVehicleTypeEventArgs> Selected;
        
        static VehicleType _VehicleType;
        
        public static VehicleType VehicleType
        {
            get { return _VehicleType; }
            set 
            {
                if (_VehicleType != value)
                {
                    _VehicleType = value; 
                    FireSelected();
                }
            }
        }
        
        static void FireSelected()
        {
            if (Selected != null)
            {
                SelectedVehicleTypeEventArgs args = new SelectedVehicleTypeEventArgs();
                args.VehicleType = _VehicleType;
                Selected(_VehicleType, args);
            }
        }
        
    }
}

